import {EditorContent, useEditor} from "@tiptap/react";
import {MyParagraph} from "./schema/pragraph";
import {MyWord} from "./schema/word";
import StarterKit from "@tiptap/starter-kit";
import React from "react";

export const Editor = () =>{
    const editor = useEditor({
        extensions: [
            StarterKit,
            MyParagraph,
            MyWord
        ],
        content:{
            type:'doc',
            content:[{
                type:'paragraph',
                content:[
                    {
                        "type": "word",
                        "attrs": {
                            "start": 23.06,
                            "end": 23.4,
                            'text': " Passage313131321"
                        }
                    },
                ]
            }]
        }
    })

    return (
        <div>
            <EditorContent editor={editor} className={"flex flex-row w-full"}/>
        </div>
    )
}



